package com.iflytek.aisol.audit.iflytek.strategy.manage.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * CLassName: serverInstance
 * Description: 上游依赖服务配置表
 * Author: wuzhixiang
 * Date: 2024-12-28 14:24
 * Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Entity
@Table(name = "ServerInstance")
public class ServerInstance implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 服务标识字段
     */
    @Column(name = "instance_id")
    private String instanceId;
    /**
     * 版本号，修改配置时需要将版本号+1，并且保留旧版本配置
     */
    private Long version;
    /**
     * 服务配置内容为json结构，根据不同的server_type此字段结构不同
     */
    @Column(name = "config")
    private String config;

    private Integer deleted;

    /**
     *
     * 服务类型，支持ive，rit，llm，rag四种类型
     */
    @Column(name = "server_type")
    private String serverType;

    /**
     * 描述信息
     */
    @Column(name = "`desc`") // 使用反引号将字段名正确映射到 `desc`
    private String description;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime = new Date();

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime = new Date();
}
